/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, {Component} from 'react';
import {
    StyleSheet,
    Text,
    View,
    FlatList,
} from 'react-native';
import {Button} from "@ant-design/react-native";
import { WebView }  from "react-native-webview";



type Props = {};
export default class RNWebView extends Component<Props> {

    constructor(props) {
        super(props);

        this.state = {
            title: 'ddd'
        }
    }

    componentDidMount() {

    }

    render() {
        return (
            <View style={styles.container}>
                <WebView
                    style={{height:200, width:200}}
                    source={{ uri: 'https://facebook.github.io/react-native' }}
                    onLoadEnd={syntheticEvent => {
                        // update component to be aware of loading status
                        const { nativeEvent } = syntheticEvent;
                        this.setState({title:nativeEvent.title});

                        //navigation.state.params.title
                        console.warn(JSON.stringify(nativeEvent));
                    }}
                />
                <Text style={{height:100}}>{this.state.title}</Text>
            </View>
        );
    }

}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#F5FCFF',
    }
});

